﻿using UnityEngine;
using TinyWnd;

public class WRankSelf : MonoBehaviour
{
    TweenPosition twPosition;
    GameObject btnGo;

    bool _show;

    void Awake()
    {
        var tran = transform;
        twPosition = tran.GetComponent<TweenPosition>();
        btnGo = Utility.FindChild(tran, "BtnGoMatch").gameObject;

        UIEventListener.Get(tran.gameObject).onClick = delegate
        {
            ClickBg();
        };

        UIEventListener.Get(btnGo).onClick = delegate
        {
            BattleMgr.inst.EnterBattle();
        };
    }

    void ClickBg()
    {
        _show = !_show;
        twPosition.Play(_show);
    }
}
